//
// Created by Administrator on 2022/1/26.
//

#ifndef CPP_LEARNING_LEETCODE77_H
#define CPP_LEARNING_LEETCODE77_H
#include <vector>
using namespace std;
#include <math.h>
#include <iostream>
#include <queue>
#include <functional>

class Solution77 {
public:
    // i 表示递归深度
    void combineHelp(vector<vector<int>>& result,vector<int>& temp, int n, int k, int depth, int curValue){
        if( depth == k){
            result.push_back(temp);
            return;
        }
        for(int i=curValue+1; i <= n; i++){
            temp.push_back(i);
            combineHelp(result, temp, n, k, depth+1,i);
            temp.pop_back();
        }
    }
    vector<vector<int>> combine(int n, int k) {
        vector<vector<int>> result;
        vector<int> temp;
        combineHelp(result, temp, n, k,0,0);
        return result;
    }
};

void test77(){
    Solution77 s;

    s.combine(4,2);


}

#endif //CPP_LEARNING_LEETCODE977_H
